package src;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Screening {
    private Movie movie;
    private ScreeningRoom room;
    private LocalDateTime startTime;
    private double price;

    public Screening(Movie movie, ScreeningRoom room, LocalDateTime startTime, double price) {
        this.movie = movie;
        this.room = room;
        this.startTime = startTime;
        this.price = price;
    }

    public Movie getMovie() {
        return movie;
    }

    public void setMovie(Movie movie) {
        this.movie = movie;
    }

    public ScreeningRoom getRoom() {
        return room;
    }

    public void setRoom(ScreeningRoom room) {
        this.room = room;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    @Override
    public String toString() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
        return movie.getTitle() +
                " - " + room.getName() +
                " - " + startTime.format(formatter) +
                " - ￥" + price;
    }
}